package io.scnb.lesson001.demo25.test6;

import org.springframework.context.annotation.Conditional;
import org.springframework.context.annotation.Configuration;

/**
 * Condition1上加了@Order注解，值为1
 * Condition2实现了Ordered接口，实现了getOrder方法，返回0
 * Condition3试下了PriorityOrdered接口，实现了getOrder方法，返回1000
 * @Conditional中的顺序：Condition1, Condition2, Condition3
 * 结果：Condition3, Condition2, Condition1
 * 排序依据：实现了PriorityOrdered接口的，优先级最高，不管它返回的数值是多少
 * 而使用@Order注解和实现Ordered接口的，按照返回值升序的顺序排序
 * 所以如果我把Condition2中getOrder的返回值改成2，则顺序变成Condition3,Condition1,Condition2
 */

@Configuration
@Conditional({Condition1.class, Condition2.class, Condition3.class})
public class MainConfig6 {
}
